// permissionsMixin.js
import { hasPermission, hasGraphPermission } from '@/utils/permission';
import { computed } from 'vue';

export const permissionsMixin = {
    setup() {
        const permissionStatus = computed(() => {
            return {
                base: hasPermission('graph:view'),
                supplyChain: hasPermission('analysis:supply-chain'),
                industryChain: hasPermission('analysis:industry-chain'),
                companyRisk: hasPermission('analysis:company-risk'),
                highTech: hasPermission('analysis:high-tech'),
                productChain: hasPermission('analysis:product-chain'),
                companyStats: hasPermission('analysis:company-stats')
            };
        });

        return { permissionStatus, hasPermission, hasGraphPermission };
    }
};